package gui.core;

import javax.swing.JFrame;

import model.ServiceFactory;
import model.datasource.DatabaseDataSource;

public class Application
{	
	HubWindow _hubWindow;
	ServiceFactory _serviceFactory;
	
	protected Application()
	{
		_serviceFactory = ServiceFactory.getInstance();
		
		_hubWindow = new HubWindow(_serviceFactory);
		_hubWindow.setSize(600, 400);
		_hubWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}
	
	public void start()
	{
		_hubWindow.initGuiComponents();
		_hubWindow.setVisible(true);
		
	}
	
	private static Application instance;
	
	public static Application getInstance()
	{
		if( instance == null )
		{
			instance = new Application();
		}
		
		return instance;
	}
	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		// TODO Auto-generated method stub
		Application.getInstance().start();
	}

}
